package xyz.mkkbjb.comment;

import java.io.Serializable;

import xyz.mkkbjb.utils.json.JsonUtils;
import xyz.mkkbjb.utils.result.ResultCode;

public class ResponseResult<T> implements Serializable {
	private static final long serialVersionUID = -6496518913911747301L;
	private Integer code;
	private T data;
	private String msg;

	public Integer getCode() {
		return code;
	}

	public T getData() {
		return data;
	}

	public ResponseResult<T> setData(T data) {
		this.data = data;
		return this;
	}

	public String getMsg() {
		return msg;
	}

	public ResponseResult<T> setMsg(String msg) {
		this.msg = msg;
		return this;
	}

	public ResponseResult<T> setCode(ResultCode resultCode) {
		this.code = resultCode.code;
		return this;
	}
	
	public ResponseResult<T> setCode(int code) {
		this.code = code;
		return this;
	}

	@Override
	public String toString() {
		return JsonUtils.objectToJson(this);
	}
}
